<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/struts-dojo-tags" prefix="sx"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pesquisar Professor Por Curso</title>
    </head>
    <body>
        <h1>Pesquisar Professor Por Curso</h1>

        <s:form action="Professor">
            <s:select name="codCurso" label="Curso" list="Cursos" listKey="codCurso" listValue="nome"></s:select>
            <s:hidden name="pesquisa" value="curso"></s:hidden>
            <s:submit action="pesquisarProfessor" value="Pesquisar"></s:submit>
                <table border>
                    <tr>
                        <td>
                            Código do Professor
                        </td>
                        <td>
                            Nome do Professor
                        </td>
                        <td>
                            Ação
                        </td>
                    </tr>
                <s:iterator value="professores">
                    <tr>
                        <td>
                            ${matricula}
                        </td>
                        <td>
                            ${nome}
                        </td>
                        <td>
                            <s:url id="editarProfessor" action="editarProfessor">
                                <s:param name="matricula" value="%{matricula}"></s:param>
                            </s:url>
                            <s:a href="%{editarProfessor}">Editar</s:a>
                        </td>
                    </tr>
                </s:iterator>
            </table>
            <s:submit action="voltarProfessor" value="Voltar"></s:submit>
        </s:form>
    </body>
</html>
